

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

<html>
<head>
<script type="text/javascript" src="helpman_topicinit.js"></script>

<title>Cross References [Enterprise Architect User Guide]</title>

<meta name="keywords" content="Enterprise Architect, Sparx Systems, UML, MDA-Style Transformation,MDA-Style Transformation Cross References,MDA-Style Transformation Specify Classifiers,Macro,Macro TRANSFORM_REFERENCE,Macro TRANSFORM_CLASSIFIER,TRANSFORM_REFERENCE,TRANSFORM_REFERENCE Macro,TRANSFORM_CLASSIFIER,TRANSFORM_CLASSIFIER Macro">
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
<meta http-equiv="Content-Style-Type" content="text/css" />

<link type="text/css" href="default.css" rel="stylesheet" />
<style type="text/css">
  A, A:Visited
  {
    color: #00F;
  }

  A:Active, A:Hover
  {
    color: #F00;
  }

  OL
  {
    margin: 5px 0 5px 48px;
  }

  UL
  {
    margin-bottom: 3px;
    margin-top: 0;
  }

  #nsr
  {
    background-color: #D4DFFF;
  }

  #nsr A
  {
    text-decoration: none;
  }

  #mainbody
  {
    padding: 8px;
  }

  .p_BodyText
  {
    padding: 5px 0;
  }
</style>



<style type="text/css" media="screen">
  BODY
  {
    background-color: #FFFFFF;
  }

  #nsr
  {
    padding: 6px 6px 0 6px;
    border-bottom: none;
    vertical-align: top;
    z-index: 2;
    visibility: visible;
    left: 0;
    top: 0;
    position: absolute;
  }

  #mainbody
  {
    left: 0;
    top: 0;
    margin: 0;
    position: absolute;
    padding: 10px;
    overflow: auto;
    height: 100%;
    z-index: 1;
    background-repeat: no-repeat;
    background-position: bottom right;
    background-attachment: fixed;
  }
</style>

<style type="text/css" media="print">
  #nsr
  {
    visibility: none;
  }

  #mainbody
  {
    overflow: visible;
  }
</style>
<script type="text/javascript" language="JavaScript" src="nonscroll.js"></script>

</head>
<body scroll="no">

<div id="page">



        <div id="content">
          <div id="content-inner">
          



  
          <div id="nsr">
            <table border="0" cellspacing="0" cellpadding="4" width="100%">
              <tr valign="top">
                <td align="left">
  


                  <p class="p_Heading1"><span class="f_Heading1">Cross References</span></p>



  
                </td>
                <td align="right">
                  <a href="introduction.htm" onmouseover="document.images.main.src='button_main_h.gif'" onmouseout="document.images.main.src='button_main.gif'">
                    <img name="main" src="button_main.gif" border=0 alt="Return to Introduction">
                  </a>&nbsp;
    
                  <a href="convertingnames.htm" onmouseover="document.images.prev.src='button_prev_h.gif'" onmouseout="document.images.prev.src='button_prev.gif'">
                    <img name=prev src="button_prev.gif" border=0 alt="Previous page" />
                  </a>&nbsp;
    
    
    
                  <a href="documentingprojects.htm" onmouseover="document.images.next.src='button_next_h.gif'" onmouseout="document.images.next.src='button_next.gif'">
                    <img name=next src="button_next.gif" border=0 alt="Next page" />
                  </a>
    
    
                </td>
              </tr>
            </table>
          </div>
          <div id="mainbody">
  


                <p class="p_BodyText"><span class="f_BodyText">Cross References are an important part of transformations. They are used to:</span></p>
<ul style="text-indent: 0px; margin-left: 30px; list-style-position: outside;">
<li><span class="f_Bulletlist1">Find the transformed Class to synchronize with</span></li>
<li><span class="f_Bulletlist1">Create connectors between transformed Classes</span></li>
<li><span class="f_Bulletlist1">Specify a classifier of a type</span></li>
<li><span class="f_Bulletlist1">Determine where to transform to for future transformations.</span></li>
</ul>
<p class="p_BodyText"><span class="f_BodyText">Each cross reference has three different parts:</span></p>
<ul style="text-indent: 0px; margin-left: 30px; list-style-position: outside;">
<li><span class="f_Bulletlist1">A </span><span class="f_Bulletlist1" style="font-style: italic;">Namespace</span><span class="f_Bulletlist1">, corresponding to the transformation that generated the element</span></li>
<li><span class="f_Bulletlist1">A </span><span class="f_Bulletlist1" style="font-style: italic;">Name</span><span class="f_Bulletlist1">, which is a unique reference to something that can be generated in the above transformation</span></li>
<li><span class="f_Bulletlist1">A </span><span class="f_Bulletlist1" style="font-style: italic;">Source</span><span class="f_Bulletlist1">, which is the GUID of the element that this element was created from.</span></li>
</ul>
<p class="p_BodyText"><span class="f_BodyText">When writing the templates for a transformation, it is easiest to create the cross references using the </span><span class="f_BodyText" style="font-weight: bold;">TRANSFORM_REFERENCE</span><span class="f_BodyText"> macro that is defined for this purpose. It has three optional parameters.</span></p>
<p style="margin: 14px 0px 0px 0px;"><span style="font-size: 10pt; font-style: italic; font-weight: bold; color: #000000;">TRANSFORM_REFERENCE(&lt;name&gt;, &lt;sourceGuid&gt;, &lt;namespace&gt;)</span></p>
<p class="p_BodyText"><span class="f_BodyText">Generates a reference that can be used in the ways described above. It resembles the following.</span></p>
<p class="p_Code"><span class="f_Code">XRef{namespace=&quot;&lt;namespace&gt;&quot; name=&quot;&lt;name&gt;&quot; source=&quot;&lt;sourceGuid&gt;&quot;</span></p>
<p class="p_BodyText"><span class="f_BodyText">Where:</span></p>
<ul style="text-indent: 0px; margin-left: 30px; list-style-position: outside;">
<li><span class="f_Bulletlist1">If &lt;</span><span class="f_Bulletlist1" style="font-style: italic;">name</span><span class="f_Bulletlist1">&gt; is not specified it gets the name of the current template</span></li>
<li><span class="f_Bulletlist1">If &lt;</span><span class="f_Bulletlist1" style="font-style: italic;">sourceGUID</span><span class="f_Bulletlist1">&gt; is not specified it gets the GUID of the current Class</span></li>
<li><span class="f_Bulletlist1">If &lt;</span><span class="f_Bulletlist1" style="font-style: italic;">namespace</span><span class="f_Bulletlist1">&gt; is not specified it gets the name of the current transformation.</span></li>
</ul>
<div style="text-align: left; text-indent: 0px; padding: 0px 0px 0px 0px; margin: 5px 0px 5px 13px;"><table cellspacing="0" cellpadding="2" border="0" style="border: none; border-spacing:0px;">
<tr style="text-align:left;vertical-align:bottom;">
<td valign="bottom" width="952" bgcolor="#efeff7" style="width:952px; background-color:#efeff7;"><p class="p_TiporNote" style="border-top: none; border-right: none; border-left: none;"><span class="f_TiporNote">Note:</span></p>
</td>
</tr>
<tr style="text-align:left;">
<td width="952" bgcolor="#f7f7ff" style="width:952px; background-color:#f7f7ff;"><p class="p_TiporNoteText"><span class="f_TiporNoteText">The only time that this should be specified is when creating a connector to a Class created in a different transformation.</span></p>
</td>
</tr>
</table>
</div>
<p class="p_BodyText"><span class="f_BodyText">A good example of the use of cross references is in the <a href="ddltransformation.htm">DDL</a> templates provided with Enterprise Architect. In the </span><span class="f_BodyText">Class</span><span class="f_BodyText"> template a cross reference is created with the name table. Then up to two different connectors can be created, each of which must identify the two Classes it connects using cross references while having its own unique cross reference.</span></p>
<p class="p_SubHeadingL1"><span class="f_SubHeadingL1">Specify Classifiers</span></p>
<p class="p_BodyText"><span class="f_BodyText">Objects, attributes, operations and parameters can all reference another element in the model as their type. When this type is created from a transformation you must use a cross reference to specify it, using the </span><span class="f_MenuKeyField">TRANSFORM_CLASSIFIER</span><span class="f_BodyText"> macro.</span></p>
<p style="margin: 14px 0px 0px 0px;"><span style="font-size: 10pt; font-style: italic; font-weight: bold; color: #000000;">TRANSFORM_CLASSIFIER(&lt;name&gt;, &lt;sourceGuid&gt;, &lt;namespace&gt;)</span></p>
<p class="p_BodyText"><span class="f_BodyText">Generates a cross reference within a classifier element, where the parameters are identical to the </span><span class="f_BodyText" style="font-weight: bold;">TRANSFORM_REFERENCE</span><span class="f_BodyText"> macro but the name </span><span class="f_BodyText" style="font-style: italic;">Classifier</span><span class="f_BodyText"> is generated instead of </span><span class="f_BodyText" style="font-style: italic;">XRef</span><span class="f_BodyText">.</span></p>
<p class="p_BodyText"><span class="f_BodyText">If the target classifier already exists in the model before the transformation, a </span><span class="f_BodyText" style="font-weight: bold;">TRANSFORM_CLASSIFIER</span><span class="f_BodyText"> is inappropriate and instead the GUID can be given directly to a classifier attribute.</span></p>
<div style="text-align: left; text-indent: 0px; padding: 0px 0px 0px 0px; margin: 5px 0px 5px 13px;"><table cellspacing="0" cellpadding="2" border="0" style="border: none; border-spacing:0px;">
<tr style="text-align:left;vertical-align:bottom;">
<td valign="bottom" width="952" bgcolor="#efeff7" style="width:952px; background-color:#efeff7;"><p class="p_TiporNote" style="border-top: none; border-right: none; border-left: none;"><span class="f_TiporNote">Note:</span></p>
</td>
</tr>
<tr style="text-align:left;">
<td width="952" bgcolor="#f7f7ff" style="width:952px; background-color:#f7f7ff;"><p class="p_TiporNoteText"><span class="f_TiporNoteText">If a classifier is specified for any type it overrides the type specified.</span></p>
</td>
</tr>
</table>
</div>




            </div>
          </div>
        </div>



</div>


</body>
</html>
